package com.wangan.wanganpush.config;

import com.wangan.wanganpush.utils.AtomicValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;

/**
 * 程序完全启动后执行
 */
@Configuration
public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent> {

    @Autowired
    SignalMonitoringConfig signalMonitoringConfig;

    @Autowired
    AtomicValue atomicValue;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        atomicValue.AtomicValueInit();
        initUserSignalMonitoring();
    }


     public void initUserSignalMonitoring(){
         try {
             signalMonitoringConfig.go(signalMonitoringConfig);
         } catch (Exception e) {
            e.printStackTrace();
         }


     }

}
